/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hetgrotemvcproject;

import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 *
 * @author student
 */
public class Model {

    private StringProperty title = new SimpleStringProperty();
    
    public String getTitle(){
        return title.get();
    }

    public void setTitle(String title){
        this.title.set(title);
    }
    
    public StringProperty titleProperty() {
        return title;
    }
    
    private StringProperty description = new SimpleStringProperty();
    
    public String getDescription(){
        return description.get();
    }

    public void setDescription(String title){
        this.description.set(title);
    }
    
    public StringProperty DescriptionProperty() {
        return description;
    }
    
    private ObjectProperty<ReminderPriority> priority = new SimpleObjectProperty<>(ReminderPriority.MEDIUM);
    
    public ReminderPriority getPriority(){
        return priority.get();
    }
    
    public void setPriority(ReminderPriority priority){
        this.priority.set(priority);
    }
    
    public ObjectProperty<ReminderPriority> priorityProperty() {
        return priority;
    }
    
    public void cancel() {
        title.set("");
        priority.set(ReminderPriority.MEDIUM);
        description.set("");
    }
    public void save(){
        System.out.printf(")Reminder save%nTitle: %s%nPriority: %s%nDescription: %s%n", title.get(), priority.get(), description.get());
    }
    
    /* SINGLETON */
    private Model() {}
    
    private static final Model instance = new Model();
    
    public static Model getInstance() {
        return instance;
    }
}
